{% load i18n %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <link rel="stylesheet" href="{{ MEDIA_URL }}css/reset.css" />
    <link rel="stylesheet" href="{{ MEDIA_URL }}css/redmond/jquery-ui-1.8.11.custom.css" />
    <link rel="stylesheet" href="{{ MEDIA_URL }}css/layout.css" />
    <link rel="stylesheet" href="{{ MEDIA_URL }}css/theme.css" />
    <script type="text/javascript" src="{{ MEDIA_URL }}js/logging.js"></script>
    <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-ui-1.8.11.custom.min.js"></script>
    <title>{% block page_title %}E-student{% endblock %}</title>
    {% block css %}{% endblock %}
    {% block js %}{% endblock %}
    <script>
    $(document).ready(function() {
      $('html').ajaxSend(function(event, xhr, settings) {
        function getCookie(name) {
            var cookieValue = null;
            if (document.cookie && document.cookie != '') {
                var cookies = document.cookie.split(';');
                for (var i = 0; i < cookies.length; i++) {
                    var cookie = jQuery.trim(cookies[i]);
                    // Does this cookie string begin with the name we want?
                    if (cookie.substring(0, name.length + 1) == (name + '=')) {
                        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                        break;
                    }
                }
            }
            return cookieValue;
        }
        if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
            // Only send the token to relative URLs i.e. locally.
            xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
        }
      });
      
      /* Default settings for date picker */
      $.datepicker.setDefaults({'dateFormat': 'dd. mm. yy'});
    });
    </script>
  </head>
  <body>
	<div id="head_container">
		<div id="head">
			<h1><a href="{% url index %}">{% block title %}Index{% endblock %}</a></h1>
			<div>
			
				<div id="userinfo">
					{% if user.is_authenticated %}
					<div id="profile" class="img" {% if user.student %}{% if user.student.latest_enrollment_sheet.image %}style="background-image: url({{ user.student.latest_enrollment_sheet.image.url }});"{% endif %}{% endif %}>&nbsp;</div>
					<div class="info">
						<b>{% if user.first_name %}{{ user.first_name }} {{ user.last_name }}{% else %}{{ user.username }}{% endif %}</b>
						<ul>
							<li><a href="{% url profile%}">Profil</a></li>
							<li><a href="{% url logout%}">Odjavi</a></li>
						</ul>
					</div>
					{% else %}
					&nbsp;
					{% endif %}
				</div>
			
				<ul id="menu">
					<li><a href="{% url index%}">Domov</a></li>
					{% if user.is_authenticated %}
					<li>
						<a href="#">Izpiti</a>
						<ul>
							<li><a href="{% url view_exams %}">Pregled izpitnih rokov</a></li>
							<li><a href="{%url exam_application%}">Prijava na izpit</a></li>
							<li><a href="{% url delete_applications %}">Pregled/brisanje prijave</a></li>
						</ul>
					</li>
					<li>
						<a href="{%url card_index%}">Kartotečni list</a>
					</li>
					<li>
						<a href="#">Vpisni list</a>
						<ul>
							<li><a href="{% url enrollment_sheet_entry %}">Vnos</a></li>
						</ul>
					</li>
          {% if perms.student.can_subjects_selection or perms.student.can_exam_result_paper or perms.exams.can_input_exam or perms.exams.can_student_list%}
					<li>
						<a href="#">Administracija</a>
						<ul>
              {% if perms.student.can_subjects_selection %}
							<li class="break_line"><a href="{% url student_subjects_selection%}">Izbirni predmeti</a></li>
              {% endif %}
              {% if perms.student.can_exam_result_paper %}
              <li><a href="{% url student_exam_result_paper %}">Vnos ocene izpita</a></li>
              {% endif %}
              {% if perms.exams.can_input_exam %}
							<li><a href="{% url input_exam %}">Vnos izpitnega roka</a></li> 
              {% endif %}
			  <li><a href="{% url modify_exam %}">Urejanje izpitnega roka</a></li>
              <li class="break_line"><a href="{% url delete_exam %}">Brisanje izpitnega roka</a></li>
			  <li><a href="{% url exam_wgrade %}">Vnos pisne ocene</a></li>
              <li class="break_line"><a href="{% url exam_grade %}">Vnos končnih ocen</a></li>
			        {% if perms.student.can_view_personal %}
			        <li><a href="{% url student %}">Osebni pod. študenta</a></li>
			        {% endif %}
              {% if perms.exams.can_student_list %}
							<li><a href="{% url student_list%}">Seznam študentov</a></li>
              {% endif %}
              {% if perms.exams.can_view_grades %}
              <li><a href="{% url list_grades %}">Prikaz ocen študenta</a></li>
              {% endif %}
			  {% if perms.exams.can_exam_list %}
							<li><a href="{% url exam_list %}">Seznam prij. na izpit</a></li>
              {% endif %}
			  {% if perms.exams.can_exam_partial_final_list %}
			  {% endif %}
							<li><a href="{% url exam_partial_list %}">Seznam ocen izpita</a></li>
							<li><a href="{% url exam_final_list %}">Seznam končnih ocen</a></li>
						</ul>
					</li>
          {% endif %}
					{% endif %}
          {% if perms.student.can_transience %}
          <li>
            <a href="#">Analize</a>
            <ul>
              {% if perms.student.can_transience %}
              <li><a href="{% url transience %}">Analiza prehodnosti</a></li>
              {% endif %}
              {% if perms.student.can_transience %}
              <li><a href="{% url subject_success %}">Analiza uspešnosti</a></li>
              {% endif %}
              {% if perms.student.can_students_school_year %}
              <li><a href="{% url students_school_year %}">Vpisani v letnik, smer/modul</a></li>
              {% endif %}	
            </ul>
          </li>
          {% endif %}
				</ul>
			</div>
		</div>
	</div>
  <div id="content_container">
    <div id="content">		
      		{% block content %}{% endblock %}
    </div> 
  </div>
	<div id="foot">
		School project, group 7, 2011, revision: {{ revision }}
	</div>
  </body>
</html>
